import request from '@/utils/request'

// 分页查询
export const quaryPageApi = (name,gender,page,pageSize)=>{
    return request.get(`/user?name=${name}&gender=${gender}&page=${page}&pageSize=${pageSize}`)
}

// 增加员工
export const addUserApi = (data)=> request.post('/user' ,data)

//修改项目
// 1.根据id查询员工数据
export const getUserByIdApi= (id)=> request.get(`/user/${id}`)

//2.修改员工数据
export const updateByIdApi=(data)=>request.put('/user',data)

//批量删除员工操作  里面的参数要是？1，2，3   
export const deleteByIdApi=(ids)=>{
    //params:这种形式是在axios中的;   axios中有将1234变成1，2，3，4这种形式的改变写法
    return request.delete('/user',{params:{ids:ids.join(',')}})
}

//登录
export const loginUser = (data)=>request.post(`/user/login`,data)